<?php
$page = Jpublic::get('page');

$search = Jpublic::get('search');

$search != '' && $search = "AND company like '%$search%'";

$fina_row = Jdb::select("SELECT count(*) as 'count' FROM `".PRE."detection` WHERE userID = $USER[uid] $search ORDER BY detectionID DESC");

$paging = $HTML -> paging("SELECT * FROM `".PRE."detection` WHERE userID = $USER[uid] $search ORDER BY detectionID DESC", $fina_row['count'], $page);

$fina_info = Jdb::getRs($paging['sql']);

$formhash = JAdmin_core::formHASH();

while ($rs = mysql_fetch_array($fina_info)) {
	
	$oper = $HTML -> table_list_oper(array(
		'modify' => "detection-form/detection-form&action=member&operation=update&id=$rs[detectionID]&formhash=$formhash",
		'delete' => "detection-form/detection-delete&action=member&id=$rs[detectionID]&formhash=$formhash"
	));
	
	$fina_list .= <<< EOF
		<tr class="table_list_con">
			<td><a href="javascript:;">$rs[company]</a></td>
			<td>$rs[person]</td>
			<td>$rs[contact]</td>
			<td>$rs[origin]</td>
			<td>$rs[detectcompany]</td>
			<td>$rs[samplingcontact]</td>
			<td>$oper</td>
		</tr>
EOF;
}
	if (trim($fina_list) == '') {
		$fina_list = '<tr class="table_list_con" style="height:100px;"><td colspan="9">未搜索到信息</td></tr>';
	}
?>
<div class="table-div">
	<table class="width-100">
		<tr class="table_list_head">
			<td width="15%">受检单位</td>
			<td width="10%">负责人</td>
			<td width="15%">联系方式</td>
			<td width="10%">任务来源</td>
			<td width="15%">检测单位</td>
			<td width="7%">联系方式</td>
			<td width="7%">操作</td>
		</tr>
		<?php echo $fina_list;?>
		<tr>
			<td colspan="7"><?php echo $paging['list'];?></td>
		</tr>
	</table>
</div>